-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of XDP support #215
Conversation
I updated the PR to make it match the rest of the repo a bit better. The biggest change is the example, where consolidated multiple metrics into one, added IPv6 support and made it's cardinality lower by not including actual addresses. Here's how the metric loos like now:
Let me know if it looks good to you. |
It seems all great but I just have one question. |
We shouldn't allow attaching to multiple interfaces in one `SEC`, because it makes `xdp` different and special. For any other kind we would export a metric like this when it fails to attach: # HELP ebpf_exporter_ebpf_program_attached Whether a program is attached # TYPE ebpf_exporter_ebpf_program_attached gauge ebpf_exporter_ebpf_program_attached{id="329"} 0 # HELP ebpf_exporter_ebpf_program_info Info about ebpf programs # TYPE ebpf_exporter_ebpf_program_info gauge ebpf_exporter_ebpf_program_info{config="something",id="329",program="trace_something",tag="bd45628e0edfd896"} 1 For `xdp` we can have partial failures and that's not great. If only one interface is allowed, a user can have multiple `SEC`s: ```c SEC("xdp/lo") int trace_lo(struct xdp_md *ctx) { return xdp_trace(ctx); } SEC("xdp/lol") int trace_lol(struct xdp_md *ctx) { return xdp_trace(ctx); } ``` And they will know which one of them fails to attach, if any: # HELP ebpf_exporter_ebpf_program_attached Whether a program is attached # TYPE ebpf_exporter_ebpf_program_attached gauge ebpf_exporter_ebpf_program_attached{id="329"} 1 ebpf_exporter_ebpf_program_attached{id="330"} 0 # HELP ebpf_exporter_ebpf_program_info Info about ebpf programs # TYPE ebpf_exporter_ebpf_program_info gauge ebpf_exporter_ebpf_program_info{config="xdp",id="329",program="trace_lo",tag="bd45628e0edfd896"} 1 ebpf_exporter_ebpf_program_info{config="xdp",id="330",program="trace_eth0",tag="bd45628e0edfd896"} 0
That's a good concern. I think we shouldn't allow attaching to multiple interfaces in one For any other program we would export a metric like this when it fails to attach:
For I added a commit to only allow a single interface in SEC("xdp/lo")
int trace_lo(struct xdp_md *ctx) {
return xdp_trace(ctx);
}
SEC("xdp/lol")
int trace_lol(struct xdp_md *ctx) {
return xdp_trace(ctx);
} And they will know which one of them fails to attach, if any:
It's less concise, but it's consistent with how other things work. Does this make sense? |
It's clearer to separate interfaces when I think it this way. It seems all good, we can roll it out. |
Implementation of XDP support for issue #208.